package cn.shenshen.shop.feign;

import cn.shenshen.shop.redis.MemberKeyPrefix;
import cn.shenshen.shop.redis.RedisService;
import cn.shenshen.shop.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * 具体实现
 */
@RestController
public class UserTokenFeignClient implements  UserTokenFeignApi {

    @Autowired
    private RedisService redisService;

    @Override
    public Result<Boolean> refreshToken(String token) {
        redisService.expire(MemberKeyPrefix.USER_TOKEN, token, MemberKeyPrefix.USER_TOKEN.getExpireSeconds());
        return Result.success(true);
    }
}
